package com.gomtel.smartdevice.activity;

import android.view.View;
import android.widget.Button;

import com.gomtel.smartdevice.R;
import com.gomtel.smartdevice.moudle.event.CommonEvent;
import com.gomtel.smartdevice.moudle.event.EventCode;
import com.gomtel.smartdevice.moudle.rxtools.EventBusUtil;

/**
 * Created by Administrator on 2018/5/29 0029.
 */

public class DeviceSettingActivity extends BaseActivity implements View.OnClickListener {

    @Override
    protected void onCreate() {
        setContentView(R.layout.activity_device_setting);
        Button verification_device = (Button) findViewById(R.id.verification_device);
        Button bind = (Button) findViewById(R.id.bind);
        Button un_bind = (Button) findViewById(R.id.un_bind);
        Button get_sys_device_info = (Button) findViewById(R.id.get_sys_device_info);
        Button get_history_step = (Button) findViewById(R.id.get_history_step);

        Button sync_time_device = (Button) findViewById(R.id.sync_time_device);
        Button setting_signs_of_datainfo = (Button) findViewById(R.id.setting_signs_of_datainfo);
        Button bp_measure = (Button) findViewById(R.id.bp_measure);
        Button foat = (Button) findViewById(R.id.foat);
        Button af_measure = (Button) findViewById(R.id.af_measure);
        Button history_af = (Button) findViewById(R.id.history_af);


        verification_device.setOnClickListener(this);
        bind.setOnClickListener(this);
        un_bind.setOnClickListener(this);
        get_sys_device_info.setOnClickListener(this);
        get_history_step.setOnClickListener(this);

        setting_signs_of_datainfo.setOnClickListener(this);
        bp_measure.setOnClickListener(this);
        foat.setOnClickListener(this);
        af_measure.setOnClickListener(this);
        history_af.setOnClickListener(this);
        sync_time_device.setOnClickListener(this);

    }


    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.bind:
                EventBusUtil.sendEvent(new CommonEvent(EventCode.DEVICE_BIND));
                break;
            case R.id.un_bind:
                EventBusUtil.sendEvent(new CommonEvent(EventCode.UN_DEVICE_BIND));
                break;
            case R.id.verification_device:
                EventBusUtil.sendEvent(new CommonEvent(EventCode.VERIFICATION_DEVICE));
                break;
            case R.id.get_sys_device_info:
                EventBusUtil.sendEvent(new CommonEvent(EventCode.SYS_DEVICE));
                break;
            case R.id.get_history_step:
                EventBusUtil.sendEvent(new CommonEvent(EventCode.HISTORY_STEP));
                break;

            case R.id.sync_time_device:
                EventBusUtil.sendEvent(new CommonEvent(EventCode.HISTORY_STEP));
                break;
            case R.id.setting_signs_of_datainfo:
                EventBusUtil.sendEvent(new CommonEvent(EventCode.SETTING_SIGNS_OF_DATAINFO));
                break;
            case R.id.bp_measure:
                EventBusUtil.sendEvent(new CommonEvent(EventCode.BP_MEASURE));
                break;
            case R.id.foat:
                EventBusUtil.sendEvent(new CommonEvent(EventCode.FOAT));
                break;
            case R.id.af_measure:
                EventBusUtil.sendEvent(new CommonEvent(EventCode.AF_MEASURE));
                break;
            case R.id.history_af:
                EventBusUtil.sendEvent(new CommonEvent(EventCode.HISTORY_AF));
                break;


        }
    }


}
